<!--  -->
<template>
  <div>
    <div class="mask" v-if="ruleFlag" @click="$emit('closeDialog')"></div>
    <div :class="['share-order',ruleFlag?'show':'']">
      <div class="top flex justify-between aligin-center pt-14">
        <span class="share-icon"></span>
        <span class="ml-6 mr-auto f-14 f-bold">{{ruleType!=3?'活动规则':'推广规则'}}</span>
        <span class="close" @click="$emit('closeDialog')"></span>
      </div>
      <template v-if="ruleType==1">
        <div class="over-auto">
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第一条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">用户每购买一款推广产品获得相应能量值，能量值自动兑换一个活动号码。</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第二条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">活动号码跟幸运号码相同即表示中奖。</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第三条内容</div>
            </div>
            <div class="mt-14 f-12 line-18 color-red flex aligin-center">
              <span class="mr-4">幸运号码 = (</span>
              <div>
                <div class="label">数值A</div>
                <div class="red-line"></div>
                <div class="label">能量值</div>
              </div>
              <span class="ml-4">) 的余数 +100001</span>
            </div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第四条内容</div>
            </div>
            <div class="mt-14 f-12">数值A根据体彩官方开奖结果得出，例如体彩排列5开奖号码为12345，那么本期的数值A=12345</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第五条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">推广产品根据售完时间不同，选取的排列5期数不同:</div>
            <div class="mt-14 f-12 line-18">1、当天下午2点之前售完的，平台采用当天开始的最新一期排列5作为数值A；</div>
            <div class="mt-14 f-12 line-18">2、当天下午2点之后售完的，平台采用第二天开始的最新一期排列5作为数值A。</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第六条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">推广产品限量推广，售完即止。</div>
          </div>
        </div>
      </template>
      <template v-else-if="ruleType==3">
        <div class="over-auto">
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第一条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">通过分享本次活动，或者分享APP给好友，好友注册后，您会自动成为推广人，推广关系永久保留，一次推广，永久受益。</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第二条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">
              本次被推广的好友中奖
              <span class="color-pink">{{abbreviation}}</span>
              ，您将会获得推广
              <span class="color-pink">{{rewardName}}</span>
            </div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第三条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">所有账号只能有一个推广人且无法更改。</div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第四条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">
              开奖后进入“
              <span class="color-pink">个人中心-团队订单</span>
              ”，可查看您的好友是否中奖；您的专属赠品会显示在“
              <span class="color-pink">个人中心-我的赠品</span>”。
            </div>
          </div>
          <div class="mt-20">
            <div>
              <div class="f-12 f-medium tip">第五条内容</div>
            </div>
            <div class="mt-14 f-12 line-18">
              您获得的赠品将会通过邮寄的方式寄给您，请关注“
              <span class="color-pink">个人中心-我的赠品-赠品详情-物流信息</span>
              ”。
            </div>
          </div>
        </div>
      </template>
      <template v-else>
        <div class="mt-20">
          <div>
            <div class="f-12 f-medium">第一条内容</div>
          </div>
          <div class="mt-14 f-12 line-18">用户选择一个奖励,在这个奖励产品下购买任何产品均可获得能量。</div>
        </div>
        <div class="mt-20">
          <div>
            <div class="f-12 f-medium">第二条内容</div>
          </div>
          <div class="mt-14 f-12 line-18">1点能量自动兑换一个活动号码</div>
        </div>
        <div class="mt-20">
          <div>
            <div class="f-12 f-medium">第三条内容</div>
          </div>
          <div class="mt-14 f-12 line-18">当奖励产品所需能量值集满以后就根据之后最新的一期时时彩作为开奖依据。</div>
        </div>
        <div class="mt-20">
          <div>
            <div class="f-12 f-medium">第四条内容</div>
          </div>
          <div class="mt-14 f-12">中奖码=最新一期时时彩 / 本奖励所需能量的余数 + 100001</div>
        </div>
        <div class="mt-20">
          <div>
            <div class="f-12 f-medium">第五条内容</div>
          </div>
          <div class="mt-14 f-12 line-18">中奖之后请在个人中心我的奖励里面查看。</div>
        </div>
        <!-- <div class="mt-20">
        <div>
          <div class="f-12 f-medium ">6.第六条内容</div>
        </div>
        <div class="mt-14 f-12 line-18">推广产品限量推广，售完即止。</div>
        </div>-->
      </template>
      <!-- <div class="mt-28 share-rule">

      </div>-->
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    ruleType: {
      type: Number,
      default: () => {
        return 1;
      }
    },
    ruleFlag: {
      type: Boolean,
      default: () => {
        return false;
      },
      required: true
    },
    abbreviation: {
      type: String,
      default: () => {
        return "";
      }
    },
    rewardName: {
      type: String,
      default: () => {
        return "";
      }
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {},
  updated() {}, //生命周期 - 更新之后
  destroyed() {} //生命周期 - 销毁完成
};
</script>
<style lang='less' scoped>
@import url("../assets/style/mixin"); //引入公共css类
.color-pink {
  color: #f0474f;
}
.mask {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0.4;
  z-index: 30;
}
.share-order {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 0 14px;
  width: 100%;
  height: 0;
  box-sizing: border-box;
  z-index: 32;
  background: #fff;
  transition: all 0.3s ease;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  .share-icon {
    width: 24px;
    height: 24px;
    .bg-image("../../assets/imgs/reword-rule");
    background-size: 100% 100%;
  }
  .close {
    height: 16px;
    width: 16px;
    .bg-image("../../assets/imgs/close-dialog");
    background-size: 100% 100%;
  }
  .line-18 {
    line-height: 18px;
  }
}
.show {
  height: 543px;
}
.tip {
  display: inline-block;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 4px 10px;
  background: #f0474f;
  color: #fff;
}
.share-rule {
  height: 494px;
  width: 100%;
  background: url("../assets/imgs/reward-rule.png");
  background-size: 100% 100%;
}
.color-red {
  color: #f0474f;
}
.label {
  width: 60px;
  text-align: center;
}
.red-line {
  height: 1px;
  width: 60px;
  background: #f0474f;
}
.over-auto {
  overflow: auto;
  height: 485px;
}
</style>